package net.dgg.rz.common.base;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import static springfox.documentation.builders.PathSelectors.regex;

/**
 * @class_name: MySwaggerConfig
 * @package: net.dgg.iboss.common
 * @describe: TODO
 * @author: zyou
 * @creat_date: 2018/5/3
 * @creat_time: 16:47
 **/
@Configuration
@EnableSwagger2
public class MySwaggerConfig {

    @Bean
    public Docket swaggerSpringfoxDocket() {
        ApiInfo apiInfo = new ApiInfoBuilder()
                .title("融资生产API列表")
                .description("融资生产API列表")
                .termsOfServiceUrl("http://dgg.net")
                .contact("融资生产")
                .version("v1.0")
                .build();
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo)
                .select()
//                .apis(RequestHandlerSelectors.basePackage("net.dgg.iboss.rzsc"))
                .paths(regex("/api/.*"))
                .build();
    }
}